<!DOCTYPE html>
<html lang="en">
    {{- $avatarImgSrc := .Site.Params.AvatarURL -}}
    {{- if and (isset .Site.Params "avatarURL") (not (hasPrefix $avatarImgSrc "http")) -}}
        {{- $avatarImgSrc = (urls.JoinPath $.Site.BaseURL ($.Site.Params.AvatarURL | default "")) -}}
    {{- end -}}
    {{- .Scratch.Set "avatarImgSrc" $avatarImgSrc -}}

    {{- partial "head.html" . -}}
    <body>
        <script>
            // Immediately set theme on page load
            setThemeByUserPref();
        </script>
        {{- partial "header.html" . -}}
        <main id="content">
        {{- block "main" . }}{{- end }}
        </main>
        {{- partial "footer.html" . -}}
    </body>
</html>
